<?php
// +----------------------------------------------------------------------
// | admin/v1【系统生成】   [ 2025-08-11 15:32:44 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2025 zhangqiquan All rights reserved.
// +----------------------------------------------------------------------
// | Author: zhangqiquan <768617998@qq.com>
// +----------------------------------------------------------------------
declare (strict_types=1);

use zhanshop\App;

App::route()->group("/cloud", function (){
      App::route()->rule("GET", "pullVolume", [\app\api\admin\v1\controller\Cloud::class, "pullVolume"]);
      App::route()->rule("POST", "gitpush", [\app\api\admin\v1\controller\Cloud::class, "gitpush"])->extra(["platform","auth"]);
      App::route()->rule("GET", "docker", [\app\api\admin\v1\controller\Cloud::class, "docker"])->extra(["path"]);
      App::route()->rule("GET", "appium", [\app\api\admin\v1\controller\Cloud::class, "getAppium"])->extra(["token"]);
      App::route()->rule("POST", "appium", [\app\api\admin\v1\controller\Cloud::class, "postAppium"])->extra(["token"]);
});

App::route()->group("/index", function (){
      App::route()->rule("GET", "index", [\app\api\admin\v1\controller\Index::class, "getIndex"]);
      App::route()->rule("GET", "main", [\app\api\admin\v1\controller\Index::class, "getMain"]);
      App::route()->rule("GET", "echarts", [\app\api\admin\v1\controller\Index::class, "getEcharts"]);
      App::route()->rule("GET", "user", [\app\api\admin\v1\controller\Index::class, "getUser"]);
      App::route()->rule("POST", "user", [\app\api\admin\v1\controller\Index::class, "postUser"]);
      App::route()->rule("GET", "clean", [\app\api\admin\v1\controller\Index::class, "clean"]);
      App::route()->rule("GET", "config", [\app\api\admin\v1\controller\Index::class, "getConfig"])->extra(["id"]);
      App::route()->rule("POST", "config", [\app\api\admin\v1\controller\Index::class, "postConfig"])->extra(["id"]);
      App::route()->rule("GET", "table", [\app\api\admin\v1\controller\Index::class, "getTable"])->extra(["id"]);
      App::route()->rule("POST", "table", [\app\api\admin\v1\controller\Index::class, "postTable"])->extra(["id"]);
      App::route()->rule("GET", "ping", [\app\api\admin\v1\controller\Index::class, "getPing"]);
})->middleware([\app\middleware\AdminAuth::class]);

App::route()->group("/passport", function (){
      App::route()->rule("POST", "login", [\app\api\admin\v1\controller\Passport::class, "postLogin"]);
      App::route()->rule("GET", "test500", [\app\api\admin\v1\controller\Passport::class, "test500"]);
});

App::route()->group("/proxy", function (){
      App::route()->rule("TCP", "socks5Message", [\app\api\admin\v1\controller\Proxy::class, "socks5Message"])->extra(["event","tofd"]);
      App::route()->rule("TCP", "httpMessage", [\app\api\admin\v1\controller\Proxy::class, "httpMessage"])->extra(["event","tofd"]);
});

App::route()->group("/ssh", function (){
      App::route()->rule("TCP", "open", [\app\api\admin\v1\controller\Ssh::class, "open"])->extra(["tofd"]);
});

App::route()->group("/storage", function (){
      App::route()->rule("POST", "uploadVideo", [\app\api\admin\v1\controller\Storage::class, "uploadVideo"]);
      App::route()->rule("POST", "files", [\app\api\admin\v1\controller\Storage::class, "files"]);
      App::route()->rule("GET", "file", [\app\api\admin\v1\controller\Storage::class, "file"])->extra(["path"]);
});

